#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QString>
#include <QMessageBox>
#include <QDebug>

#include "control/mycontrol.h"
#include "model/basemodel.h"
#include "model/usermodel.h"
#include "data/user.h"
#include "view/managerwidget.h"
#include "view/userwidget.h"


class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = nullptr);
    void init_Control();
        void init_Widget();
        void init_Connect();//初始化连接信号和槽
        int loginCheck();//登录检查

    private:
        QPushButton *loginBtn;
        QPushButton *registerBtn;
        QPushButton *outBtn;

        QLabel *usernameLab;
        QLabel *passwordLab;

        QLineEdit *usernameEdit;
        QLineEdit *passwordEdit;

        QHBoxLayout *layEdit;
        QHBoxLayout *layname;
        QHBoxLayout *laypswd;
        QVBoxLayout *laycombined;

        ManagerWidget *managerWidget;

        MyControl *control;
        BaseModel *model;

        User *user;

        UserWidget *userWidget;

private slots:
        void on_regBtn_cliked();//注册按钮的槽函数
        void on_loginBtn_cliked();//登录按钮的槽函数


public slots:
};

#endif // LOGINWIDGET_H
